<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title> - 登录</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico"> <link href="/dt200_admin/Public/home/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/dt200_admin/Public/home/css/font-awesome.css?v=4.4.0" rel="stylesheet">

    <link href="/dt200_admin/Public/home/css/animate.css" rel="stylesheet">
    <link href="/dt200_admin/Public/home/css/style.css?v=4.1.0" rel="stylesheet">
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <script>if(window.top !== window.self){ window.top.location = window.location;}</script>
</head>

<body class="gray-bg">

    <div class="middle-box text-center loginscreen  animated fadeInDown">
        <div>
            <div>

                <h1 class="logo-name">h</h1>

            </div>
            <h3>欢迎使用 hAdmin</h3>

            <form class="m-t" role="form" action="" method="POST" id="myForm">
                <div class="form-group">
                    <input type="text" class="form-control" placeholder="用户名" name="admin_name" id="admin_name">
                </div>
                <div class="form-group">
                    <input type="password" class="form-control" placeholder="密码" name="password" id="password">
                </div>
                <button type="button" class="btn btn-primary block full-width m-b" id="btn-login">登 录</button>


                <p class="text-muted text-center"> <a href="login.html#"><small>忘记密码了？</small></a> | <a href="register.html">注册一个新账号</a>
                </p>

            </form>
        </div>
    </div>

    <!-- 全局js -->
    <script src="/dt200_admin/Public/home/js/jquery.min.js?v=2.1.4"></script>
    <script src="/dt200_admin/Public/home/js/bootstrap.min.js?v=3.3.6"></script>
    <script src="/dt200_admin/Public/home/js/plugins/jquery.form.js"></script>
	
	<script type="text/javascript">
        $(function(){
            $("#btn-login").click(function(){
            	console.log($("#admin_name").val())
//              $("#myForm").submit();
				$.ajax({
					type:"post",
					url:"/dt200_admin/Home/Login/login",
					async:true,
					data:{
						'admin_name':$("#admin_name").val(),
						'password':$("#password").val(),
					},
					dataType:"json",
					success:function(result){
						if(result.code == 0){
							alert(result.msg);
						}else{
							location.href = "/dt200_admin/Home/Index/index"
						}
					}
				
				});
            });
        });
    </script>
    
    

</body>

</html>